package myky.com.doctorapp.fragment;

import android.app.Dialog;
import android.app.DialogFragment;
import android.app.FragmentManager;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;

import myky.com.doctorapp.R;

public class LoadingFragmentDialog extends DialogFragment {


    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {

        LayoutInflater layoutInflater=getActivity().getLayoutInflater();

        View view=layoutInflater.inflate(R.layout.loading_fragment,null);
        Dialog dialog=new Dialog(getActivity(),R.style.dialog);
        dialog.setContentView(view);
        return dialog;
    }


    @Override
    public void show(FragmentManager manager, String tag) {

        if (!this.isAdded()){
            try {

        super.show(manager, tag);
            }catch (Exception e){}
        }
    }
    @Override
    public void dismiss() {
        try {
            super.dismiss();
        } catch (Exception e) {
        }
    }
}
